package cn.humaohua.study.yanmo_design_pattern.ch15.v4;

public class Client {
    //TODO  error result
    public static void main(String[] args) {
        //定义所有的组合对象
        Component root = new Composite("服装");
        Component c1 = new Composite("男装");
        Component c2 = new Composite("女装");
        Component c3 = new Composite("女装");



        //按照树的结构来组合对象的叶子对象
        root.addChild(c1);
        root.addChild(c2);
        root.addChild(c3);


        //调用根对象的输出功能来输出整棵树
        root.printStruct("");
    }
}
